// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	12/29/2013 8:57:55 PM				
// -----------------------------

#ifndef _Vector4_h
#define _Vector4_h

#include "Defines.h"

struct Vector2;
struct Vector3;

struct Vector4
{

	/* Constants */
	static const Vector4	Zero;
	static const Vector4	One;
	static const Vector4	UnitX;
	static const Vector4	UnitY;
	static const Vector4	UnitZ;

	/* Datamembers */
	Float	x;
	Float	y;
	Float	z;
	Float	w;

	/* Constructors */
	Vector4();
	Vector4(Float X, Float Y, Float Z);
	Vector4(Float X, Float Y, Float Z, Float W);
	Vector4(Float arr[4]);

	Vector4(const Vector4& refVector);
	Vector4(const Vector3& refVector, Float W);
	Vector4(const Vector2& refVector, Float Z, Float W);

	Vector4& operator=(const Vector4& refVector);

	/* Comparison Operators */
	Bool operator==(const Vector4& refVector) const;
	Bool operator!=(const Vector4& refVector) const;
	Bool operator<(const Vector4& refVector) const;
	Bool operator>(const Vector4& refVector) const;
	Bool operator<=(const Vector4& refVector) const;
	Bool operator>=(const Vector4& refVector) const;

	/* Mathematical In-Place operators */
	Vector4& operator+=(const Vector4& refVector);
	Vector4& operator-=(const Vector4& refVector);
	Vector4& operator*=(Float fScalar);
	Vector4& operator/=(Float fScalar);

	/* Mathematical Out-Of-Place Operators */
	Vector4 operator+(const Vector4& refVector) const;
	Vector4 operator-(const Vector4& refVector) const;
	Vector4 operator-() const;
	Vector4 operator*(Float fScalar) const;
	Vector4 operator/(Float fScalar) const;

	/* Mathematical Friend Operators */
	friend Vector4 operator*(Float fScalar, const Vector4& refVector);

	/* Methods */
	Float		Length() const;
	Vector4		Normalized() const;
	Vector4		CrossProduct(const Vector4& refVector) const;
	Float		DotProduct(const Vector4& refVector) const;
	void		AsArray(Float arr[4]) const;
	Vector4		Lerp(const Vector4& other, Float alpha) const;

};

#endif